/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class CurrencyType extends SimpleTransferObject {

    private static final long serialVersionUID = -1475931171358365861L;

    private static final byte DOLLAR_ID = 10;
    private static final byte REAL_ID = 20;

    public static final CurrencyType DOLLAR = new CurrencyType(DOLLAR_ID, "Dolar");
    public static final CurrencyType REAL = new CurrencyType(REAL_ID, "Real");

    static {
        Class<CurrencyType> clazz = CurrencyType.class;
        addObject(clazz, DOLLAR);
        addObject(clazz, REAL);
    }

    private CurrencyType(int i, String str) {

        super(i, str);
    }
    
    public boolean isDollar() {

        return getId() == DOLLAR_ID;
    }

    @SuppressWarnings("unchecked")
    public static List<CurrencyType> getList() {

        return (List<CurrencyType>) getList(CurrencyType.class);
    }

    public static CurrencyType getCurrencyTypeById(int typeId) {

        return (CurrencyType) getObject(CurrencyType.class, typeId);
    }

}
